package com.ly.service;

import java.util.List;
import java.util.Map;

import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.system.common.mapper.BisShopPostMapper;
import com.system.common.pojo.BisShopPost;
import com.system.common.pojo.BisShopPostExample;
import com.system.common.pojo.BisShopPostExample.Criteria;

@Service
public class ShopPostServiceImpl implements ShopPostService{

	/**
	 * 综合查询
	 */
	@Autowired
	BisShopPostMapper postMapper;

	@Override
	public List<BisShopPost> selectByExample(Map<String, Object> map) {
		String postCode = (String) map.get("postCode");
		String postName = (String) map.get("postName");
		BisShopPostExample example = new BisShopPostExample();
		Criteria criteria = example.createCriteria();
		if (StringUtils.isNotBlank(postCode)) {
			criteria.andPostCodeLike("%" + postCode + "%");
		}
		if (StringUtils.isNotBlank(postName)) {
			criteria.andPostNameLike("%" + postName + "%");
		}
		return postMapper.selectByExample(example);
	}

}
